package by.grsu.hdm.devices;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

import by.grsu.hdm.model.Audio;
import by.grsu.hdm.model.IFormat;
import by.grsu.hdm.model.Video;

public class RemoteControl {

	public void play(IFormat format, HttpServletResponse response, String s) throws IOException {
		response.setContentType("text/html; charset=UTF-8");
		if (format instanceof Audio) {
			
			PrintWriter pw = response.getWriter();
			pw.print("песня " + s + " проигрывается");
		}
		if (format instanceof Video) {
				PrintWriter pw = response.getWriter();
				pw.print("видео " + s + " проигрывается");
		
		}
	}

	public void stop(IFormat format, HttpServletResponse response, String s) throws IOException {
		response.setContentType("text/html; charset=UTF-8");
		if (format instanceof Audio) {
			PrintWriter pw = response.getWriter();
			pw.print("песня " + s + " остановлена");
		}
		if (format instanceof Video) {
			
				PrintWriter pw = response.getWriter();
				pw.print("видео " + s + " остановлено");
		
		}
	}

	public void pause(IFormat format, HttpServletResponse response, String s) throws IOException {
		response.setContentType("text/html; charset=UTF-8");
		if (format instanceof Audio) {
			PrintWriter pw = response.getWriter();
			pw.print("песня " + s + " поставлена на паузу");
		}
		if (format instanceof Video) {
		
				PrintWriter pw = response.getWriter();
				pw.print("видео " + s + " поставлено на паузу");
	
		}
	}
}
